#include <stdio.h>

int main(int argc, char const *argv[])
{
    int ch;

    int space = 0;
    int letter = 0;
    int others = 0;

    while(1)
    {
        ch = getchar(); // 错误的时候返回-1

        if(ch == '#')
            break;

        switch(ch)
        {
        case ' ':
            space++;
            break;

        case 'a' ... 'z':
        case 'A' ... 'Z':
            letter++;
            break;
        
        default:
            others++;
        }
    }

    printf("空格数: %d\n", space);
    printf("字母数: %d\n", letter);
    printf("其他字符: %d\n", others);

    return 0;
}
